import Vue from 'vue';
import Antd, { message, notification } from 'ant-design-vue';
import 'ant-design-vue/dist/antd.less';

import DAlert from './DAlert.vue';
import DAvatar from './DAvatar.vue';
import DBadge from './DBadge.vue';
import DBreadcrumb from './DBreadcrumb.vue';
import DBreadcrumbItem from './DBreadcrumbItem.vue';
import DButton from './DButton.vue';
import DCard from './DCard.vue';
import DCarousel from './DCarousel.vue';
import DCheckbox from './DCheckbox.vue';
import DCheckboxGroup from './DCheckboxGroup.vue';
import DCol from './DCol.vue';
import DCollapse from './DCollapse.vue';
import DCollapsePanel from './DCollapsePanel.vue';
import DConfigProvider from './DConfigProvider.vue';
import DConfirm from './DConfirm';
import DDescriptions from './DDescriptions.vue';
import DDescriptionsItem from './DDescriptionsItem.vue';
import DDivider from './DDivider.vue';
import DDrawer from './DDrawer.vue';
import DDropdown from './DDropdown.vue';
import DEmpty from './DEmpty.vue';
import DForm from './DForm.vue';
import DFormItem from './DFormItem.vue';
import DIcon from './DIcon.vue';
import DInput from './DInput.vue';
import DInputGroup from './DInputGroup.vue';
import DInputDropdown from './DInputDropdown.vue';
import DInputNumber from './DInputNumber.vue';
import DInputPassword from './DInputPassword.vue';
import DInputSearch from './DInputSearch.vue';
import DList from './DList.vue';
import DMenu from './DMenu.vue';
import DSubMenu from './DSubMenu.vue';
import DMenuItemGroup from './DMenuItemGroup.vue';
import DMenuItem from './DMenuItem.vue';
import DModal from './DModal.vue';
import DPagination from './DPagination.vue';
import DPopover from './DPopover.vue';
import DProgress from './DProgress.vue';
import DRadio from './DRadio.vue';
import DRadioGroup from './DRadioGroup.vue';
import DRow from './DRow.vue';
import DSelect from './DSelect.vue';
import DSelectOption from './DSelectOption.vue';
import DSpace from './DSpace.vue';
import DSpin from './DSpin.vue';
import DStep from './DStep.vue';
import DSteps from './DSteps.vue';
import DSwitch from './DSwitch.vue';
import DTable from './DTable.vue';
import DTextarea from './DTextarea.vue';
import DTooltip from './DTooltip.vue';
import DTree from './DTree.vue';
import DDirectoryTree from './DDirectoryTree.vue';
import DTreeNode from './DTreeNode.vue';
import DTextButton from './DTextButton.vue';
import DTabs from './DTabs.vue';
import DTabPane from './DTabPane.vue';
import DLocaleProvider from './DLocaleProvider.vue';
import DTag from './DTag.vue';
import DUpload from './DUpload.vue';
import DTransfer from './DTransfer.vue';
import DRangePicker from './DRangePicker.vue';

Vue.use(Antd);

message.config({
  prefixCls: `tw-message`,
  maxCount: 1
});

Vue.prototype.$dConfirm = DConfirm;
Vue.prototype.$dMessage = message;
Vue.prototype.$dNotification = notification;

function install(Vue) {
  Vue.component('DAlert', DAlert);
  Vue.component('DAvatar', DAvatar);
  Vue.component('DBadge', DBadge);
  Vue.component('DBreadcrumb', DBreadcrumb);
  Vue.component('DBreadcrumbItem', DBreadcrumbItem);
  Vue.component('DButton', DButton);
  Vue.component('DCard', DCard);
  Vue.component('DCarousel', DCarousel);
  Vue.component('DCheckbox', DCheckbox);
  Vue.component('DCheckboxGroup', DCheckboxGroup);
  Vue.component('DCol', DCol);
  Vue.component('DCollapse', DCollapse);
  Vue.component('DCollapsePanel', DCollapsePanel);
  Vue.component('DConfigProvider', DConfigProvider);
  Vue.component('DDescriptions', DDescriptions);
  Vue.component('DDescriptionsItem', DDescriptionsItem);
  Vue.component('DDivider', DDivider);
  Vue.component('DDrawer', DDrawer);
  Vue.component('DDropdown', DDropdown);
  Vue.component('DEmpty', DEmpty);
  Vue.component('DForm', DForm);
  Vue.component('DFormItem', DFormItem);
  Vue.component('DIcon', DIcon);
  Vue.component('DInput', DInput);
  Vue.component('DInputGroup', DInputGroup);
  Vue.component('DInputDropdown', DInputDropdown);
  Vue.component('DInputNumber', DInputNumber);
  Vue.component('DInputPassword', DInputPassword);
  Vue.component('DInputSearch', DInputSearch);
  Vue.component('DList', DList);
  Vue.component('DMenu', DMenu);
  Vue.component('DSubMenu', DSubMenu);
  Vue.component('DMenuItemGroup', DMenuItemGroup);
  Vue.component('DMenuItem', DMenuItem);
  Vue.component('DModal', DModal);
  Vue.component('DPagination', DPagination);
  Vue.component('DPopover', DPopover);
  Vue.component('DProgress', DProgress);
  Vue.component('DRadio', DRadio);
  Vue.component('DRadioGroup', DRadioGroup);
  Vue.component('DRow', DRow);
  Vue.component('DSelect', DSelect);
  Vue.component('DSelectOption', DSelectOption);
  Vue.component('DSpace', DSpace);
  Vue.component('DSpin', DSpin);
  Vue.component('DStep', DStep);
  Vue.component('DSteps', DSteps);
  Vue.component('DSwitch', DSwitch);
  Vue.component('DTable', DTable);
  Vue.component('DTextarea', DTextarea);
  Vue.component('DTooltip', DTooltip);
  Vue.component('DTree', DTree);
  Vue.component('DDirectoryTree', DDirectoryTree);
  Vue.component('DTreeNode', DTreeNode);
  Vue.component('DTextButton', DTextButton);
  Vue.component('DTabs', DTabs);
  Vue.component('DTabPane', DTabPane);
  Vue.component('DLocaleProvider', DLocaleProvider);
  Vue.component('DTag', DTag);
  Vue.component('DUpload', DUpload);
  Vue.component('DTransfer', DTransfer);
  Vue.component('DRangePicker', DRangePicker);
}

export const dMessage = message;
export const dNotification = notification;

export default {
  DAlert,
  DAvatar,
  DBadge,
  DBreadcrumb,
  DBreadcrumbItem,
  DButton,
  DCard,
  DCarousel,
  DCheckbox,
  DCheckboxGroup,
  DCol,
  DCollapse,
  DCollapsePanel,
  DConfigProvider,
  DDescriptions,
  DDescriptionsItem,
  DDivider,
  DDrawer,
  DDropdown,
  DEmpty,
  DForm,
  DFormItem,
  DIcon,
  DInput,
  DInputDropdown,
  DInputNumber,
  DInputPassword,
  DInputSearch,
  DList,
  DMenu,
  DSubMenu,
  DMenuItemGroup,
  DMenuItem,
  DModal,
  DPagination,
  DPopover,
  DProgress,
  DRadio,
  DRadioGroup,
  DRow,
  DSelect,
  DSelectOption,
  DSpace,
  DSpin,
  DStep,
  DSteps,
  DSwitch,
  DTable,
  DTextarea,
  DTooltip,
  DTree,
  DDirectoryTree,
  DTreeNode,
  DTextButton,
  DTabs,
  DTabPane,
  DLocaleProvider,
  DTag,
  DUpload,
  DRangePicker,
  dMessage,
  dNotification,
  install
};
